@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* 淡黄色桂花色调 - 温暖的米黄色背景 */
    --background: 48 100% 97%;
    --foreground: 25 35% 20%;
    --card: 48 80% 98%;
    --card-foreground: 25 35% 20%;
    --popover: 48 80% 98%;
    --popover-foreground: 25 35% 20%;
    /* 主色：温暖的橙色/金黄色 */
    --primary: 35 100% 55%;
    --primary-foreground: 0 0% 100%;
    /* 次要色：淡米黄色 */
    --secondary: 45 60% 95%;
    --secondary-foreground: 25 35% 25%;
    --muted: 45 50% 94%;
    --muted-foreground: 25 25% 45%;
    --accent: 40 80% 92%;
    --accent-foreground: 25 35% 20%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;
    /* 边框：淡黄色 */
    --border: 45 40% 85%;
    --input: 45 40% 90%;
    --ring: 35 100% 55%;
    /* 苹果风格大圆角 */
    --radius: 1rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 217.2 91.2% 59.8%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 224.3 76.3% 48%;
  }
}

@layer base {
  * {
    border-color: hsl(var(--border));
  }
  body {
    background: linear-gradient(135deg, hsl(48 100% 97%) 0%, hsl(45 90% 96%) 100%);
    background-attachment: fixed;
    color: hsl(var(--foreground));
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
      'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
      sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    letter-spacing: -0.01em;
  }
}

@layer utilities {
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  @media (max-width: 768px) {
    .container {
      padding: 10px;
    }
  }

  /* 兼容旧样式类（用于管理端） */
  .card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    /* 苹果风格柔和阴影 */
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .card:hover {
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08), 0 2px 6px 0 rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.625rem 1.25rem;
    letter-spacing: -0.01em;
  }

  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }

  .btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
  }

  .btn-primary:hover:not(:disabled) {
    background-color: hsl(var(--primary) / 0.9);
  }

  .btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
  }

  .btn-secondary:hover:not(:disabled) {
    background-color: hsl(var(--secondary) / 0.8);
  }

  .btn-danger {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
  }

  .btn-danger:hover:not(:disabled) {
    background-color: hsl(var(--destructive) / 0.9);
  }

  .input {
    display: flex;
    height: 2.75rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1.5px solid hsl(var(--input));
    background-color: hsl(var(--background));
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
  }

  .input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 4px hsl(var(--ring) / 0.15);
    background-color: hsl(48 100% 99%);
  }
  
  .input::placeholder {
    color: hsl(var(--muted-foreground) / 0.6);
  }

  .modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }

  .modal-content {
    background: hsl(var(--card));
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.15), 0 8px 24px -8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
  }

  @media (max-width: 768px) {
    .modal-content {
      padding: 1.25rem;
      width: 95%;
    }
  }
}

